<template>
  <div class="mall-container">
    <scroller :pulldown-config="pulldownConfig" :pullup-config="pullupConfig" height="100%" lock-x scrollbar-y
              use-pullup use-pulldown
              @pullup:loading="loadMore" @pulldown:loading="refresh" :pullup-status.sync="pullupStatus" v-ref:scroller>
      <div class="top-img">
        <img @click="clickImg" class="top-img-1" src="http://static.52letsgo.cn/zz/wechatimg/bg_mall.png" alt="">
      </div>
    </scroller>

  </div>
</template>
<script>
  import Scroller from './../../components/scroller/index.vue'
  import {content} from './../../vuex/getters'
  import {set_test} from './../../vuex/actions'
  var Global = require('./../../commons/js/Global');
  export default{
    data(){
      return {
        pulldownConfig: {
          content: '下拉刷新',
          downContent: '松开进行刷新',
          upContent: '下拉刷新',
          loadingContent: '刷新中...'
        },
        pullupConfig: {
          content: '下拉加载更多',
          downContent: '松开进行加载',
          upContent: '下拉加载更多',
          loadingContent: '加载中...'
        },
        pullupEnabled: true,
        pullupStatus: 'default',
      }
    },
    ready: function () {
      Global.closeLoading();
    },
    components: {
      Scroller
    },
    methods: {
      loadMore(uuid){
        this.$nextTick(() => {
          this.$broadcast('pullup:reset', uuid);
          this.$refs.scroller.reset({
            top: 0
          })
        })
      },
      refresh(uuid){
        this.$nextTick(() => {
          this.$broadcast('pullup:reset', uuid);
          this.$refs.scroller.reset({
            top: 0
          })
        })
      },
      clickImg(){
        
      }
    }

  }
</script>
<style lang="less">
  @import "mall.less";
</style>
